Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const uint8_t *SIGNALS[] = {
- sinewave
- ...
- };
- void static inline Signal_OUT(const uint8_t *signal, uint8_t ad2, uint8_t ad1, uint8_t ad0)
- {
- asm volatile(
- "eor r18, r18 ;r18<-0" "\n\t"
- "eor r19, r19 ;r19<-0" "\n\t"
- "1:" "\n\t"
- "add r18, %0 ;1 cycle" "\n\t"
- "adc r19, %1 ;1 cycle" "\n\t"
- "adc %A3, %2 ;1 cycle" "\n\t"
- "lpm ;3 cycles" "\n\t"
- "out %4, r0 ;1 cycle" "\n\t"
- "sbis %5, 2 ;1 cycle if no skip" "\n\t"
- "rjmp 1b ;2 cycles. Total 10 cycles" "\n\t"
- :
- :"r" (ad0),"r" (ad1),"r" (ad2),"e" (signal),"I" (_SFR_IO_ADDR(PORTA)), "I" (_SFR_IO_ADDR(PORTD))
- :"r18", "r19"
- );
- }
- Signal_OUT(SIGNALS[SG.mode], ...);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement